home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWEvents / Include / FWEventD.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.8 KB  |  104 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEventD.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWEVENTD_H
  11. #define FWEVENTD_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifndef FWRUNTYP_H
  18. #include "FWRunTyp.h"
  19. #endif
  20.  
  21. #ifndef FWPOINT_H
  22. #include "FWPoint.h"
  23. #endif
  24.  
  25. // ----- OpenDoc Includes -----
  26.  
  27. #ifndef _ODTYPES_
  28. #include <ODTypes.h>
  29. #endif
  30.  
  31. #ifndef FWODMISS_H
  32. #include "FWODMiss.h"
  33. #endif
  34.  
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma lib_export on
  37. #endif
  38.  
  39. //==============================================================================
  40. //    Forward Declarations
  41. //==============================================================================
  42.  
  43. class FW_CLASS_ATTR FW_MEventHandler;
  44. class FW_CLASS_ATTR FW_CMenuBar;
  45. class FW_CLASS_ATTR ODFrame;
  46. class FW_CLASS_ATTR ODFacet;
  47.  
  48. //==============================================================================
  49. //     class FW_CEventDispatcher
  50. //==============================================================================
  51.  
  52. class FW_CLASS_ATTR FW_CEventDispatcher
  53. {
  54. public:
  55.     FW_DECLARE_CLASS
  56.  
  57.     FW_CEventDispatcher();
  58.     FW_CEventDispatcher(FW_MEventHandler* theEventHandler, FW_CMenuBar* theMenuBar);
  59.     virtual ~ FW_CEventDispatcher();
  60.     
  61.     virtual FW_Boolean     Dispatch(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet, ODEventInfo* eventInfo);
  62.  
  63. protected:
  64.     virtual FW_Boolean     DispatchNullEvent(Environment* ev, ODEventData* event, ODFrame* odFrame);
  65.     virtual FW_Boolean    DispatchMouseDownEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet, FW_Boolean inBackground);
  66.     virtual FW_Boolean     DispatchMouseUpEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet);
  67.     virtual FW_Boolean     DispatchEmbeddedMouseDownEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet, ODEventInfo* eventInfo, FW_Boolean inBackground);
  68.     virtual FW_Boolean     DispatchEmbeddedMouseUpEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet, ODEventInfo* eventInfo);
  69.     virtual FW_Boolean     DispatchBorderMouseDownEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet, ODEventInfo* eventInfo);
  70.     virtual FW_Boolean     DispatchVirtualKeyDownEvent(Environment* ev, ODEventData* event, ODFrame* odFrame);
  71.     virtual FW_Boolean     DispatchVirtualKeyUpEvent(Environment* ev, ODEventData* event, ODFrame* odFrame);
  72.     virtual FW_Boolean     DispatchCharKeyEvent(Environment* ev, ODEventData* event, ODFrame* odFrame);
  73.     virtual FW_Boolean     DispatchActivateEvent(Environment* ev, ODEventData* event, ODFrame* odFrame, ODFacet* odFacet);
  74.     virtual FW_Boolean     DispatchMenuEvent(Environment* ev, ODEventData* event, ODFrame* odFrame);
  75.     virtual FW_Boolean     DispatchMouseEnterEvent(Environment* ev, ODFacet* odFacet, ODEventInfo* eventInfo);
  76.     virtual FW_Boolean     DispatchMouseWithinEvent(Environment* ev, ODFacet* odFacet, ODEventInfo* eventInfo);
  77.     virtual FW_Boolean     DispatchMouseLeaveEvent(Environment* ev, ODFacet* odFacet, ODEventInfo* eventInfo);
  78.     
  79. #ifdef FW_BUILD_MAC
  80.     virtual FW_Boolean     DispatchWindowEvent(Environment* ev, ODEventData* event, ODFacet* odFacet);
  81.     virtual FW_Boolean     DispatchOSEvent(Environment* ev, ODEventData* event, ODFacet* odFacet);
  82. #endif
  83.  
  84.     static short        OnMouseDown(Environment* ev, ODEventData* event);
  85.     static void            OnMouseUp(Environment* ev, ODEventData* event);
  86.     
  87.     static unsigned short         gAutoRepeatCount;
  88.     
  89.     static unsigned long         gLastMouseUp;
  90.     static short                 gClickCount;
  91.  
  92. private:
  93.     FW_MEventHandler*             fEventHandler;
  94.     FW_CMenuBar*                 fMenuBar;        // For translating menu events to commands
  95.     FW_MEventHandler*            fLastMouseDownTarget;
  96.     FW_MEventHandler*            fLastMouseDownFrame;
  97. };
  98.  
  99. #if FW_LIB_EXPORT_PRAGMAS
  100. #pragma lib_export off
  101. #endif
  102.  
  103. #endif
  104.